package com.ylyq.ylxx.model.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
 * @ClassName UpdatePlanInfoRequest
 * @Description TODO
 * @Author xiaweichao
 * @Date 2020/6/30 17:42
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "修改广告计划请求参数")
public class UpdatePlanInfoRequest {
    @ApiModelProperty(value = "广告主ID")
    @NotNull(message = "广告主ID不能为空")
    private Long advertiser_id;

    @ApiModelProperty(value = "广告计划ID")
    @NotNull(message = "广告计划ID不能为空")
    private String ad_id;

    @ApiModelProperty(value = "广告名称，长度为1-100个字符，其中1个中文字符算2位")
    private String name;

    @ApiModelProperty(value = "修改时间戳，从ad/get接口获得")
    @NotNull(message = "修改时间戳不能为空")
    private String modify_time;

    @ApiModelProperty(value = "\t广告预算(出价方式为CPC、CPM、CPV时，不少于100元；出价方式为OCPM、OCPC时，不少于300元。单次预算修改幅度不小于100元,日修改预算不超过20次)。如果是总预算广告，且设了起始日期，将要求您预算设置需要大于或等于[投放天数 * 100]，即满足每日最低预算300的要求。取值范围: ≥ 0")
    private Long budget;

    @ApiModelProperty(value = "广告投放时间类型,SCHEDULE_FROM_NOW\t从现在开始一直投放\tSCHEDULE_START_END\t选择起始时间")
    private String schedule_type;

    @ApiModelProperty(value = "广告投放起始时间，当schedule_type为\"SCHEDULE_START_END\"时必填，形式如：2017-01-01 00:00 广告投放起始时间不允许修改")
    private String start_time;

    @ApiModelProperty(value = "广告投放结束时间，当schedule_type为\"SCHEDULE_START_END\"时必填，形式如：2017-01-01 00:00")
    private String end_time;

    @ApiModelProperty(value = "广告投放时段，默认全时段投放，格式是48*7位字符串，且都是0或1。也就是以半个小时为最小粒度，周一至周日每天分为48个区段，0为不投放，1为投放，不传、全传0、全传1均代表全时段投放。")
    private String schedule_time;

    @ApiModelProperty(value = "广告出价，当pricing为\"CPC\"、\"CPM\"、\"CPV\"出价方式时必填，取值范围: ≥ 0")
    private Long bid;

    @ApiModelProperty(value = "ocpm广告转化出价， 当pricing为\"OCPM\"、\"OCPC\"、\"CPA\"出价方式时必填，注：OCPC只有穿山甲可用）\n" +
            "取值范围: 0.1-10000")
    private Long cpa_bid;

    @ApiModelProperty(value = "广告投放速度类型,FLOW_CONTROL_MODE_FAST\t优先跑量（对应CPC的加速投放）\tFLOW_CONTROL_MODE_SMOOTH\t优先低成本（对应CPC的标准投放）\tFLOW_CONTROL_MODE_BALANCE\t均衡投放（新增字段）")
    private String flow_control_mode;

    @ApiModelProperty(value = "转化id， 当pricing为\"OCPM\"时必填，当pricing为\"CPC\"和\"CPM\"时非必填。")
    private Long convert_id;

    @ApiModelProperty(value = "深度优化方式， DEEP_BID_DEFAULT\t无深度优化\tDEEP_BID_PACING\t自动优化\tDEEP_BID_MIN\t自定义双出价\tROI_COEFFICIENT\tROI系数\tROI_PACING\t自动优化\tMIN_SECOND_STAGE\t自定义两阶段\tSMARTBID\t自动出价\tAUTO_MIN_SECOND_STAGE\t自动出价两阶段\n")
    private String deep_bid_type;

    @ApiModelProperty(value = "深度优化出价，deep_bid_type为\"DEEP_BID_MIN\"时必填。当对应的转化convert_id，设定深度转化目标（deep_external_action）时才会有效。")
    private Long deep_cpabid;

    @ApiModelProperty(value = "过滤已转化用户类型字段。NO_EXCLUDE\t不过滤\tAD\t广告计划\tCAMPAIGN\t广告组\tADVERTISER\t广告账户\tAPP\tAPP\tCUSTOMER\t公司账户")
    private String hide_if_converted;

    @ApiModelProperty(value = "过滤已安装，当推广目标为安卓应用下载时可填，0表示不过滤，1表示过滤，默认为不过滤\n" +
            "默认值:0\n" +
            "允许值: 0, 1")
    private Integer hide_if_exists;

    @ApiModelProperty(value = "过滤时间范围，ONE_MONTH\t1个月\tTHREE_MONTH\t3个月\tSIX_MONTH\t6个月\tTWELVE_MONTH\t12个月")
    private String converted_time_duration;

    @ApiModelProperty(value = "鲁班ROI出价策略系数")
    private Float luban_roi_goal;

    @ApiModelProperty(value = "深度转化ROI系数, 范围(0,5]，精度：最多4位小数, deep_bid_type为\"ROI_COEFFICIENT\"时可传")
    private Float roi_goal;

    @ApiModelProperty(value = "定向包ID")
    private Integer audience_package_id;

    @ApiModelProperty(value = "广告落地页链接（支持橙子建站落地页和第三方落地页）；\n" +
            "对于转化为目标的计划如OCPM、CPA计划进入审核后将不允许更改，即计划下创建创意后不可更改\n" +
            "非转化为目标的计划如CPC、CPM计划可用更改无此限制。")
    private String external_url;

    @ApiModelProperty(value = "应用直达链接")
    private String open_url;

    /**
     * @Author xiaweichao
     * @Description //以下是受众包参数  * @Date 15:18 2020/6/29
     * @Param
     * @return
     **/


    @ApiModelProperty(value = "定向人群包列表，内容为人群包id。（新增字段，使用新增字段支持同时选择定向和排除）")
    private Long[] retargeting_tags_include;

    @ApiModelProperty(value = "排除人群包列表，内容为人群包id。（新增字段，使用新增字段支持同时选择定向和排除）")
    private Long[] retargeting_tags_exclude;

    @ApiModelProperty(value = "受众性别, 允许值: \"GENDER_FEMALE\", \"GENDER_MALE\", \"NONE\"")
    private String gender;

    @ApiModelProperty(value = "受众年龄区间, 允许值: \"AGE_BETWEEN_18_23\", \"AGE_BETWEEN_24_30\",\"AGE_BETWEEN_31_40\", \"AGE_BETWEEN_41_49\", \"AGE_ABOVE_50\"")
    private String[] age;

    @ApiModelProperty(value = "受众运营商, 允许值: \"MOBILE\", \"UNICOM\", \"TELCOM\"")
    private String[] carrier;

    @ApiModelProperty(value = "受众网络类型, 允许值: \"WIFI\", \"2G\", \"3G\", \"4G\"")
    private String[] ac;

    @ApiModelProperty(value = "受众手机品牌, 允许值: \"APPLE\", \"HUAWEI\", \"XIAOMI\", \"SAMSUNG\", \"OPPO\", \"VIVO\",\"MEIZU\", \"GIONEE\", \"COOLPAD\", \"LENOVO\", \"LETV\", \"ZTE\",\"CHINAMOBILE\", \"HTC\", \"PEPPER\", \"NUBIA\", \"HISENSE\", \"QIKU\", \"TCL\",\"SONY\", \"SMARTISAN\", \"360\", \"ONEPLUS\", \"LG\", \"MOTO\", \"NOKIA\",\"GOOGLE\"")
    private String[] device_brand;

    @ApiModelProperty(value = "受众文章分类, 允许值: \"ENTERTAINMENT\", \"SOCIETY\", \"CARS\", \"INTERNATIONAL\",\"HISTORY\", \"SPORTS\", \"HEALTH\", \"MILITARY\", \"EMOTION\", \"FASHION\",\"PARENTING\", \"FINANCE\", \"AMUSEMENT\", \"DIGITAL\", \"EXPLORE\", \"TRAVEL\",\"CONSTELLATION\", \"STORIES\", \"TECHNOLOGY\", \"GOURMET\", \"CULTURE\",\"HOME\", \"MOVIE\", \"PETS\", \"GAMES\", \"WEIGHT_LOSING\", \"FREAK\",\"EDUCATION\", \"ESTATE\", \"SCIENCE\", \"PHOTOGRAPHY\", \"REGIMEN\", \"ESSAY\",\"COLLECTION\", \"ANIMATION\", \"COMICS\", \"TIPS\", \"DESIGN\", \"LOCAL\",\"LAWS\", \"GOVERNMENT\", \"BUSINESS\", \"WORKPLACE\", \"RUMOR_CRACKER\",\"GRADUATES\"")
    private String[] article_category;

    @ApiModelProperty(value = "用户首次激活时间, 允许值: \"WITH_IN_A_MONTH\", \"ONE_MONTH_2_THREE_MONTH\",\"THREE_MONTH_EAILIER\"")
    private String[] activate_type;

    @ApiModelProperty(value = "地域类型，允许值: \"CITY\", \"COUNTY\" , \"BUSINESS_DISTRICT\",\"NONE\"，省市传法：\"city\": [12],\"district\": \"CITY\",区县的传法：\"city\": [130102],\"district\": \"COUNTY\",")
    private String district;

    @ApiModelProperty(value = "地域定向城市或者区县列表(当传递省份ID时,旗下市县ID可省略不传),当district为\"CITY\"时必填, 详见【附件-city.json】")
    private Long[] city;

    @ApiModelProperty(value = "商圈ID数组，district为\"BUSINESS_DISTRICT\"时必填")
    private Long[] business_ids;

    @ApiModelProperty(value = "受众位置类型，详见【附录-受众位置类型】当city和district有值时必填")
    private String location_type;

    @ApiModelProperty(value = "（老版）兴趣分类,如果传空数组 ] 表示不限，如果只传[0]表示系统推荐,如果按兴趣类型传表示自定义，兴趣类型详见[【附件-ad_tag.json】")
    private Long[] ad_tag;

    @ApiModelProperty(value = "（老版）兴趣关键词, 传入具体的词id，非兴趣词包id，可以通过词包相关接口或者兴趣关键词word2id接口获取词id，一个计划下最多创建1000个关键词。")
    private Long[] interest_tags;

    @ApiModelProperty(value = "精选流量包，NONE\t不限\tAPP\t应用软件精选流量包\tGAME\t游戏精选流量包。对于选择自定义流量包，传flow_package或exclude_flow_package字段即可")
    private String superior_popularity_type;

    @ApiModelProperty(value = "\t定向流量包ID数组")
    private Long[] flow_package;

    @ApiModelProperty(value = "排除流量包ID数组")
    private Long[] exclude_flow_package;

    @ApiModelProperty(value = "设备类型。允许值是：\"MOBILE\", \"PAD\"。缺省表示不限设备类型。穿山甲已经全量，站内需要有白名单权限才可以")
    private String[] device_type;

    @ApiModelProperty(value = "是否启用智能放量。允许值是：0、1。缺省为 0。")
    private Integer auto_extend_enabled;

    @ApiModelProperty(value = "可放开定向。当auto_extend_enabled=1 时选填。缺省为全不选.REGION\t地域\tGENDER\t性别\tAGE\t年龄\tCUSTOM_AUDIENCE\t自定人群-定向\tINTEREST_ACTION\t行为兴趣")
    private String[] auto_extend_targets;

    @ApiModelProperty(value = "手机价格定向,传入价格区间，最高传入11000（表示1w以上）\n" +
            "传值示例 \"launch_price\": [2000, 11000]，表示2000元以上")
    private Long[] launch_price;

    @ApiModelProperty(value = "\t行为兴趣选择\n" +
            "允许值：\"UNLIMITED\",\"CUSTOM\",\"RECOMMEND\"")
    private String interest_action_mode;

    @ApiModelProperty(value = "行为场景，当interest_action_mode传CUSTOM时有效\n" +
            "允许值：E-COMMERCE\t电商行为场景\tNEWS\t资讯行为场景\tAPP\tapp行为场景")
    private String[] action_scene;

    @ApiModelProperty(value = "行为天数，当interest_action_mode传CUSTOM时有效\n" +
            "允许值：7, 15, 30, 60, 90, 180, 365")
    private Integer action_days;

    @ApiModelProperty(value = "行为类目，当interest_action_mode传CUSTOM时有效")
    private Long[] action_categories;

    @ApiModelProperty(value = "行为关键词，当interest_action_mode传CUSTOM时有效")
    private Long[] action_words;

    @ApiModelProperty(value = "兴趣分类,如果传空数组 [] 表示不限，如果只传[0]表示系统推荐,如果按兴趣类型传表示自定义，当interest_action_mode传CUSTOM时有效")
    private Long[] interest_categories;

    @ApiModelProperty(value = "兴趣关键词, 传入具体的词id，非兴趣词包id，可以通过词包相关接口或者兴趣关键词word2id接口获取词id，一个计划下最多创建1000个关键词。当interest_action_mode传CUSTOM时有效")
    private Long[] interest_words;

    @ApiModelProperty(value = "（抖音推广特有）账号粉丝相似人群（添加抖音账号，会将广告投放给对应账号的相似人群粉丝）\t\n")
    private Long[] aweme_fans_numbers;

    @ApiModelProperty(value = "（抖音推广特有）过滤高活跃用户\n" +
            "允许值：0表示不过滤，1表示过滤")
    private Integer filter_aweme_abnormal_active;

    @ApiModelProperty(value = "（抖音推广特有）过滤高关注数用户，例如\"filter_aweme_fans_count\": 1000表示过滤粉丝数在1000以上的用户")
    private Long filter_aweme_fans_count;

    @ApiModelProperty(value = "（抖音推广特有）过滤自己的粉丝\n" +
            "允许值：0表示不过滤，1表示过滤")
    private Integer filter_own_aweme_fans;

    @ApiModelProperty(value = "抖音号id，与aweme_fan_behaviors同时设置才会生效（抖音达人定向）")
    private Long[] aweme_fan_accounts;

    @ApiModelProperty(value = "抖音类目id，与aweme_fan_behaviors同时设置才会生效（抖音达人定向）")
    private Long[] aweme_fan_categories;

    @ApiModelProperty(value = "抖音用户行为类型, FOLLOWED_USER\t已关注用户\tCOMMENTED_USER\t15天内已评论用户\tLIKED_USER\t15天内已点赞用户\tSHARED_USER\t15天内已分享用户")
    private String[] aweme_fan_behaviors;

    @ApiModelProperty(value = "地图位置")
    private CreatePlanInfoRequest.Geolocation geolocation;

    @NoArgsConstructor
    @Data
    public static class Geolocation {

        /**
         * advertiser_id : 12312321
         * advertiser_name : test_developer
         * advertiser_role : 1
         * is_valid : true
         */
        @ApiModelProperty(value = "地点名字")
        private Long radius;
        @ApiModelProperty(value = "地图位置")
        private String name;
        @ApiModelProperty(value = "经度")
        private Float long_;
        @ApiModelProperty(value = "纬度")
        private Float lat;
        @ApiModelProperty(value = "地图位置")
        private String city;
        @ApiModelProperty(value = "街道号")
        private String street_number;
        @ApiModelProperty(value = "街道名")
        private String street;
        @ApiModelProperty(value = "区域名")
        private String district;
        @ApiModelProperty(value = "省份名")
        private String province;
    }
}
